<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %>

<!DOCTYPE html PUBLIC "-//W3C//Ddiv HTML 4.01 divansitional//EN" "http://www.w3.org/div/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-81">
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
  <title>人马君</title>
</head>
<body>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav fs-header-small">
          <a href="${ctx.host}/rounds/${courseRoundId}/weekly-plan/exercise?week=${week}<c:choose><c:when test='${not empty scheduleId}'>&scheduleId=${scheduleId}</c:when><c:otherwise><c:if test='${not empty back}'>&back=${back}</c:if></c:otherwise></c:choose>" class="icon icon-left pull-left"></a>
          <h1 class="title" style="font-weight: bold;">第${week}周计划-运动</h1>
        </header>
        
        <div class="bar bar-footer">
          <a href="javascript:void(0);" class="button save-button">保存</a>
        </div>
        
        <div class="content">
          <div class="content">
            <form method="post" action="${ctx.host}/rounds/${courseRoundId}/weekly-plan/${batchId}/edit-exercise">
              <input type="hidden" name="_method" value="PATCH">
            
              <div class="diet-wrap edit-exercise-wrap" style="padding-bottom: 1rem;">
                <div class="card" style="margin: .5rem 0;">
                  <div class="card-header">家庭作业</div>
                  <div class="card-content">
                    <div style="padding: .5rem .75rem;border-bottom: 1px solid #e1e1e1;">家庭作业完成
                      <input type="number"  name="homeworkFrequency" style=" width: 5rem; text-align: center; border: none; border-bottom: 1px solid #333;" value="${exercise.homeworkFrequency}" placeholder="输入完成次数">次
                    </div>
                    <div class="card-content-inner">
                      <div class="action-header">
                        <label class="action-title">LISS/低强度恒速有氧训练</label>
                      </div>
                      <div class="action-content">
                        <div class="checkbox-layout" data-name="lissTypes">
                          <label>快走 <input type="checkbox" name="lissTypes" value="QUICK_WALK" <c:if test="${fn:contains(exercise.lissType, '0')}">checked</c:if>></label>
                          <label>慢跑 <input type="checkbox" name="lissTypes" value="JOGGING" <c:if test="${fn:contains(exercise.lissType, '1')}">checked</c:if>></label>
                          <label>踏台阶 <input type="checkbox" name="lissTypes" value="STEP" <c:if test="${fn:contains(exercise.lissType, '2')}">checked</c:if>></label>
                          <label>爬楼 <input type="checkbox" name="lissTypes" value="CLIMB" <c:if test="${fn:contains(exercise.lissType, '3')}">checked</c:if>></label>
                          <label>游泳 <input type="checkbox" name="lissTypes" value="SWIMMING" <c:if test="${fn:contains(exercise.lissType, '4')}">checked</c:if>></label>
                        </div>
                        <div class="action-content">
                          <input type="text" name="otherLiss" value="${exercise.otherLiss}" style="width: 100%; padding: .2rem;" placeholder="如有其他请输入">
                        </div>
                      </div>
                    </div>
                    <div class="card-content-inner">
                      <div class="action-header">
                        <label class="action-title">HIIT/高强度间歇训练</label>
                      </div>
                      <div class="action-content">
                        <textarea name="hit" placeholder="请输入" >${exercise.hit}</textarea>
                      </div>
                    </div>
                    <div class="card-content-inner">
                      <div class="action-header">
                        <label class="action-title">核心训练</label>
                      </div>
                      <div class="action-content">
                        <textarea name="core" placeholder="请输入">${exercise.core}</textarea>
                      </div>
                    </div>
                    <div class="card-content-inner">
                      <div class="action-header">
                        <label class="action-title">备注</label>
                      </div>
                      <div class="action-content">
                        <textarea name="remark" placeholder="请输入">${exercise.remark}</textarea>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="card" style="margin: .5rem 0;">
                  <div class="card-header" style="border-bottom: 1px solid #e1e1e1;">门店训练</div>
                  <div class="card-content">
                    <div style="padding: .5rem .75rem; border-bottom: 1px solid #e1e1e1;">门店训练频率保证一周
                      <input type="number"  name="scheduleFrequency" style=" width: 5rem; text-align: center; border: none; border-bottom: 1px solid #333;" value="${exercise.scheduleFrequency}" placeholder="输入完成次数">次
                    </div>
                    <div class="item-content">
                      <c:forEach begin="1" end="7" var="i">
                        <c:set var="day" value="${i}${''}"></c:set>
                        <div class="card-content-inner">
                          <div class="action-header">
                            <label class="action-title">day ${i}</label>
                          </div>
                          <div class="action-content">
                            <div>
                              <p class="exercise-subtitle">上课内容:</p>
                              <div class="checkbox-layout" data-day="checkbox" style="margin-top:0;">
                                <label>腹 <input type="checkbox" name="day${i}" value="ABDOMEN" <c:if test="${fn:contains(schedules[day].content, '0')}">checked</c:if>></label>
                                <label>背 <input type="checkbox" name="day${i}" value="BACK" <c:if test="${fn:contains(schedules[day].content, '1')}">checked</c:if>></label>
                                <label>胸 <input type="checkbox" name="day${i}" value="CHEST" <c:if test="${fn:contains(schedules[day].content, '2')}">checked</c:if>></label>
                                <label>肩 <input type="checkbox" name="day${i}" value="SHOULDER" <c:if test="${fn:contains(schedules[day].content, '3')}">checked</c:if>></label>
                                <label>臀 <input type="checkbox" name="day${i}" value="HIP" <c:if test="${fn:contains(schedules[day].content, '4')}">checked</c:if>></label>
                                <label>手臂 <input type="checkbox" name="day${i}" value="ARM" <c:if test="${fn:contains(schedules[day].content, '5')}">checked</c:if>></label>
                                <label>腿 <input type="checkbox" name="day${i}" value="LEG" <c:if test="${fn:contains(schedules[day].content, '6')}">checked</c:if>></label>
                                <label>体能 <input type="checkbox" name="day${i}" value="FITNESS" <c:if test="${fn:contains(schedules[day].content, '7')}">checked</c:if>></label>
                                <label>其他 <input type="checkbox" name="day${i}" value="OTHER" <c:if test="${fn:contains(schedules[day].content, '8')}">checked</c:if>></label>
                              </div>
                            </div>
                          </div>
                        </div>
                      </c:forEach>
                    </div>
                </div>
              </div>
              
              <button type="submit" style="display: none;" value="提交"></button>
            </form>
          </div>
        </div>
      </div>
    </div>
    
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/courseware/weekly-plan-exercise-edit.js" />
  <script type="text/javascript">
    require(['page/courseware/weekly-plan-exercise-edit'], function(page) {
      page.init({
        courseRoundId : '${courseRoundId}',
        weekId : '${week}'
      })
    })
  </script>
  
  </body>
</html>
